import request from "@/utils/request";
// 获取部门根节点
export function getRootDepartment() {
    return request({
        url: `/api/v1/department/root/node`,
        method: "get",
    });
}
// 添加部门
export function addDepartment(data) {
    return request({
        url: `/api/v1/department/addDepartment`,
        method: "post",
        data
    });
}
// 通过祖先id获取所有单层子节点
export function getListByAncestorId(ancestor_id) {
    return request({
        url: `/api/v1/department/descendants/getList/${ancestor_id}`,
        method: "get",
    });
}
//删除部门
export function DeleteDepartment(id) {
    return request({
        url: `/api/v1/department/deleteById/${id}`,
        method: "delete",
    });
}
// 修改部门
export function AlterDepartment(data) {
    return request({
        url: `/api/v1/root/department/alter`,
        method: "put",
        data
    });
}
// 通过部门id获取该部门
export function getDepartmentById(id) {
    return request({
        url: `/api/v1/department/getDepartment/${id}`,
        method: "get",
    });
}
// 通过部门id获取部门成员
export function getDepartmentMember(id, limit, page) {
    return request({
        url: `/api/v1/department/getDepartmentMember/${id}/${limit}/${page}`,
        method: "get",
    });
}
// 迁移部门
export function MigrateDepartment(data) {
    return request({
        url: `/api/v1/root/user/alter`,
        method: "put",
        data
    });
}